package com.z996.spring6;

import com.z996.spring6.controller.UserController;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 简述:<br>
 * 实验十三： xml的自动装配
 *
 * @Author zfh18
 * @Date 2024-02-02 15:27
 * @Version 1.0
 **/
public class DIAutowireTest {
    private Logger logger = LoggerFactory.getLogger(DIAutowireTest.class);


    /**
     * @Description 基于 xml的自动装配
     * @Author zfh18
     * @Date 15:38 2024-02-02
     **/
    @Test
    public void testByClass() {

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean-DI-Autowire.xml");
        UserController uc = context.getBean(UserController.class);
        uc.saveUser();


    }

}
